<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajaxtest页面无刷新</title>

    <script type="text/javascript">
        function f() {
            var obj = document.getElementById("url");
            var value = obj.value;
            alert(value);
            document.getElementById("iframe1").src=value;
        }
    </script>
</head>
<body>
<div>
    <p>请输入你要访问得地址：</p>
    <input type="text" id="url">
    <input type="button" value="提交" onclick="f()">
</div>

<div>
    <iframe id="iframe1" style="width: 100%;height: 500px"></iframe>
</div>
</body>
</html>